package com.tm.d10_time;

import java.time.Instant;

/**
 * 2024/5/24 Instant的使用 Cjj 16:13
 */
public class Test5_Instant {
    public static void main(String[] args) {
        //1.创建Instant的对象,获取当前时间信息
        Instant now = Instant.now();//不可变对象

        //2.获取总秒数
        long epochSecond = now.getEpochSecond();
        System.out.println(epochSecond);

        //3.获取纳秒数
        int nano = now.getNano();
        System.out.println(nano);





    }
}
